function scrollPic() {
    var scrollPic = new ScrollPic();
    scrollPic.scrollContId   = "scrollPic"; //内容容器ID
    scrollPic.arrLeftId      = "LeftArr";//左箭头ID
    scrollPic.arrRightId     = "RightArr"; //右箭头ID

    scrollPic.frameWidth     = 590;//显示框宽度
    scrollPic.pageWidth      = 197; //翻页宽度

    scrollPic.speed          = 10; //移动速度(单位毫秒，越小越快)
    scrollPic.space          = 10; //每次移动像素(单位px，越大越快)
    scrollPic.autoPlay       = true; //自动播放
    scrollPic.autoPlayTime   = 3; //自动播放间隔时间(秒)

    scrollPic.initialize(); //初始化
}
function post(url) {
    var temp = document.createElement("form");
    temp.action = url;
    temp.method = "post";
    temp.style.display = "none";
    var opt = document.createElement("textarea");
    opt.name = "keyWords";
    var keyWords = $("#keyWords").val();
    if(keyWords=="请输入关键词"){
        keyWords = "";
    }
    opt.value = keyWords;
    temp.appendChild(opt);
    document.body.appendChild(temp);
    temp.submit();
    return temp;
}


function subStr(titles,length){
    for(var i=0; i<titles.length; i++){
        var title ="";
        var len = 0;
        var a;
        if(navigator.appName.indexOf("Internet Explorer") >= 0){
            a = titles[i].innerText;
        }else{
            a = titles[i].text;
        }
        var str = a.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
        for (var j=0; j<str.length; j++) {
            var c = str.charCodeAt(j);
            var s = str.substring(j,j+1);
            //单字节加1
            if ((c >= 0x0001 && c <= 0x007e) || (0xff60<=c && c<=0xff9f)) {
                len++;
            }else {
                len+=2;
            }
            if(len > length){
                title += "......";
                break;
            }else{
                title += s;
            }
        }
        if(window.navigator.userAgent.indexOf("Firefox") >= 0){
            titles[i].text = title;
        }else{
            titles[i].innerText = title;
        }
    }
}
